package com.itstyle.seckill.topic.jichu;

import java.util.HashMap;

/**
 * @Auther: liuwenxiang
 * @Date: 2020/3/9 16:15
 * @Description:
 */
public class TestHashMap {



    /*private String name;
    private int age;

    private TestHashMap(String name,int age){
        this.name=name;
        this.age=age;
    }

    public static void main(String[] args) {
        Map<String,TestHashMap> personMap =new HashMap<>();
        personMap.put("张三",new TestHashMap("张三",21));
        personMap.put("李四",new TestHashMap("李四",19));
        personMap.put("王五",new TestHashMap("王五",25));
        personMap.put("赵六",new TestHashMap("赵六",24));
        personMap.put("孙七",new TestHashMap("孙七",32));
        personMap.put("周八",new TestHashMap("周八",17));
        personMap.put("钱九",new TestHashMap("钱九",24));
        personMap.put("吴十",new TestHashMap("吴十",23));
    }*/



    private static HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(2, 0.75f);

    public static void main(String[] args) throws InterruptedException {
        map.put(5, 55);

        new Thread("Thread1-Name") {
            public void run() {
                System.out.println("Thread1-Name Start");
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                map.put(7, 77);//断点位置 1
                System.out.println(map);
            }

        }.start();
        new Thread("Thread2-Name") {

            public void run() {
                try {
                    System.out.println("Thread2-Name Start");
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                map.put(3, 33);// 断点位置2
                System.out.println(map);
            }

        }.start();


        // 断点位置 3
        System.out.println("Thread-Main-Name Start");
        System.out.println("Thread-Main-Name Start");
        System.out.println("Thread-Main-Name Start");

        TestHashMap person =new TestHashMap();
        person.hashCode();
        Thread.sleep(500000);

    }

}
